<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<title>登陆 - 用户中心</title>
		
		<%@ include file="/common/include/title.jsp" %>
		<link rel="stylesheet" href="${rootpath }/common/resource/bootstrapvalidator/css/bootstrapValidator.min.css"/>
		<script type="text/javascript" src="${rootpath }\common\resource\bootstrapvalidator\js\bootstrapValidator.min.js">
		</script>
		
		<script type="text/javascript">
			$(document).ready(function() {
			    $('#form').bootstrapValidator({
			        container: 'tooltip',
					//trigger: 'blur',
			        feedbackIcons: {
			            valid: 'glyphicon glyphicon-ok',
			            invalid: 'glyphicon glyphicon-remove',
			            validating: 'glyphicon glyphicon-refresh'
			        },
			        fields: {
				       loginName: {
			                validators: {
			                    stringLength: {
			                        min: 4,
			                        max: 20,
			                        message: '学号的长度为4-->20'
			                    },
			                    notEmpty: {
			                        message: '学号必填'
			                    },
			          
			                }
			            },
			            password: {
			                validators: {
			                    stringLength: {
			                        min: 4,
			                        max: 20,
			                        message: '密码的长度为4-->20'
			                    },
			                    notEmpty: {
			                        message: '密码必填'
			                    }
			                }
			            },
			            code: {
			                validators: {
			                    stringLength: {
			                        min: 4,
			                        max: 4,
			                        message: '验证码的长度必须为4位'
			                    },
			                    notEmpty: {
			                        message: '验证码必填'
			                    }
			                }
			            }
			        }
			    });
			});
		</script>
	</head>
	<body>
		<%@ include file="/common/include/header.jsp"%>
	
		<div class="container">
			<div class="col-sm-8 col-sm-offset-1">
				<form id="form" class="form-horizontal" method="post" action="${rootpath }/loginSubmit.htm">
					<input type="hidden" name="returnUrl" value="">
	
					<h2 class="col-sm-offset-1 form-signin-heading">欢迎登陆请销假管理系统</h2>
					<div class="form-group">
						<label for="email" class="col-sm-2 control-label">学号</label>
						<div class="col-sm-8">
							<input type="text" id="loginName" name="loginName" class="form-control"
								value="" placeholder="学号">
						</div>
					</div>
					<div class="form-group">
						<label for="inputPassword" class="col-sm-2 control-label">密码</label>
						<div class="col-sm-8">
							<input type="password" name="password" id="inputPassword"
								class="form-control" placeholder="密码" />
						</div>
					</div>
					<div class="form-group">
						<label for="email" class="col-sm-2 control-label">验证码</label>
						<div class="col-sm-8">
							<div class="input-group">
								<span class="input-group-addon"> 
									<a href="#" tabindex="-1" onclick="return refreshCode('imgCode');"> 
										<img id="imgCode" src="${rootpath }/randImg.htm" title="点击刷新验证码" width="75" height="20" />
									</a>
								</span> 
								<input type="text" id="code" name="code" class="form-control" placeholder="验证码">
							</div>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-2">
							<button class="btn btn-lg btn-primary" type="submit">登陆</button>
							<a href="${rootpath }/regsiter.htm" class="btn btn-lg btn-primary">注册</a>
						</div>
					</div>
				</form>
			</div>
		</div>
	
	
		<!-- 提示信息 -->
		<c:if test="${info != null && info != '' }">
			<div class="container">
				<div class="col-sm-8 col-sm-offset-1">
					<div class="alert alert-warning alert-dismissible fade in" role="alert">
						<button type="button" class="close" data-dismiss="alert" aria-label="Close">
							<span aria-hidden="true">×</span>
						</button>
						${info }
					</div>
				</div>
			</div>
		</c:if>
	
		<%@ include file="/common/include/footer.jsp"%>
	</body>
</html>